import Router from 'koa-router'
import UserController from '@/api/UserController.js'
import AdminController from '@/api/AdminController.js'

const router = new Router({
  prefix: '/admin'
})
// 获取用户信息
router.get('/user', UserController.getUserList)
router.put('/user', UserController.updateUser)
router.delete('/user', UserController.deleteUser)
router.get('/check-user', UserController.checkUserName)
router.post('/user', UserController.addUser)
router.put('/user-batch', UserController.updateUserBatch)

router.get('/menu', AdminController.getMenu)
router.post('/menu', AdminController.addMenu)
router.delete('/menu/:id', AdminController.deleteMenu)
router.put('/menu', AdminController.updateMenu)

router.get('/role', AdminController.getRole)
router.post('/role', AdminController.addRole)
router.delete('/role/:id', AdminController.deleteRole)
router.put('/role', AdminController.updateRole)
export default router
